Ext.onReady(function(){
	Ext.define('department',{
		extend : 'Ext.data.Model',
		fields : ['id','name']
	});
	
	var st = Ext.create('Ext.data.Store',{
		model : 'department',
		data : [
		{id:'1',name:'研发'},
		{id:'2',name:'测试'},
		{id:'3',name:'销售'}
		]
	});
	
	Ext.create('Ext.form.Panel',{
		title: 'combobox',
		height:500,
		width:300,
		renderTo : Ext.getBody(),
		defaults:{
			labelSeparator:':',
			width:200,
			allowBlank:false,
			msgTarget:'side',
			labelAlign:'left'
		},
		items : [{
			xtype : 'combobox',
			listConfig:{
				emptyText : 'NO',
				maxHeight : 200
			},
			fieldLabel:'选择部门',
			queryMode : 'local',
			store : st,
			valueField : 'id',
			displayField : 'name',
			blankText : '部门不能为空',
			forceSelection : true,
			typeAhead : true,  //自动补全
			value : '1'
		}]
	});
})